package com.foton.limiter.construstlimiter.base.validator.impl;

import cn.hutool.core.util.StrUtil;
import com.foton.limiter.construstlimiter.base.validator.ParamValidator;
import com.foton.limiter.construstlimiter.base.validator.TransferRequest;
import lombok.extern.slf4j.Slf4j;
import org.springframework.core.annotation.Order;
import org.springframework.stereotype.Component;

/**
 * @Author RenPu
 * @Date 2023/9/4 15:36
 * @Version 1.0
 * @Description: 付款方式校验
 **/

@Order(0)
@Slf4j
@Component
public class PaylerValidatorImpl implements ParamValidator {
    @Override
    public void checkParam(TransferRequest transferRequest) {
        if(StrUtil.isBlank(transferRequest.getNOparam().toString())){
            throw new RuntimeException("支付方式 ￥￥￥￥￥，不能为空。请进行检查！！！！");
        }
        log.info("PAYLER  执行完成参数的校验："+transferRequest.getNOparam());
    }
}
